<!-- 主体内容 -->
<style type="text/css">
	.m-i-b-p-repost{padding:0;display: block;}
	.attach_box{margin:5px 0;}
	.m-i-b-p-repost{padding: 0.75em;}
	#pager_box{margin-bottom: 1.5em}
</style>
<div id="weibo-type-nav" class="pure-g">
    <div class="pure-u-1-2 weibo-type-nav-item <php>if($type=='receive'){</php>active<php>}</php>" onclick="$('#footer a>div:eq(1)').trigger('click')">收到的评论</div>
    <div class="pure-u-1-2 weibo-type-nav-item <php>if($type=='send'){</php>active<php>}</php>" onclick="$('#footer a>div:eq(2)').trigger('click')">发出的评论</div>
    <php>if($type=='receive'){</php>
    	<div class="pure-u-1-2 ani" id="weibo-type-nav-bar" style="position:absolute;bottom:0;left:0;"></div>
    <php>}else{</php>
    	<div class="pure-u-1-2 ani" id="weibo-type-nav-bar" style="position:absolute;bottom:0;left:50%;"></div>
    <php>}</php>
</div>
<!-- 主体内容 -->
<php>if(empty($commentlist)) {</php>暂无更多信息<php>}</php>
	<volist name="commentlist" id="feed">
	<div id="comment_item_{$feed.comment_id}">
		<div class="microblog-item ts-listen" data-listen="weibo-detail-{$feed.sourceInfo.feed_id}" data-id="{$feed.sourceInfo.feed_id}">
			<!-- header -->
	        <div class="media m-i-header">
	            <div class="pull-left m-i-h-avatar">
                    <a href="{:U('w3g/Index/weibo',array('uid'=>$feed['user_info']['uid']))}"><img class="media-object m-i-h-a-img" src="{$feed.user_info.avatar_small}"></a>
	            </div>
	            <div class="media-body m-i-h-info">
                    <div class="m-i-h-i-l-name"><a class="m-i-h-i-l-name" href="{:U('w3g/Index/weibo',array('uid'=>$feed['user_info']['uid']))}">{$feed.user_info.uname}</a></div>
	                <div class="m-i-h-i-l-description">
	                	<php>if($feed['app'] == 'weiba' || $feed['app'] == 'w3g' || $feed['app'] == 'public'){
								$ctime=strtotime($feed[ctime]);
								echo friendlyDate($ctime);
							}else{
								echo friendlyDate($feed[ctime]);
							}
						</php>
						{$feed.from}
	                </div>
	            </div>
	            <div class="m-i-h-right"></div>
	        </div>
	        <div class="m-i-body">
	            <p class="m-i-b-p" id="m-i-b-p-{$feed.sourceInfo.feed_id}">
	                <php>
						if($feed[to_comment_id] != 0){
							$res = M('Comment')->where('comment_id='.$feed[to_comment_id])->find();
							$uname = getUserName($feed[to_uid]);
                            echo wapFormatContent($feed[content].' //@<a href="'.U(\'w3g/Index/weibo\',array(\'uid\'=>$feed[to_uid])).'">'.$uname.'</a>：'.$res[content]);
						}else{
							echo wapFormatContent($feed[content]);
						}
					</php>
					<php>if($feed[sourceInfo][is_del] == 0){</php>
						<neq name="feed.sourceInfo.type" value="weiba_post">
							<!-- 原文的图 -->
							<php>if($feed['sourceInfo']['type']=='postimage') {</php>
								<div id="repost-{$feed['sourceInfo'][feed_id]}" class="m-i-b-p m-i-b-p-repost ts-listen" style="padding:0;background:rgba(3,3,3,0.1);" data-listen="weibo-detail-{$feed['sourceInfo']['feed_id']}">
									<img class="m-i-b-r-p" style="height:100%;float:left;width:33.3333%;max-width:33.3333%;" src="{$feed['sourceInfo']['attach'][0]['attach_small']}" />
									<div style="float:right;width: 63%;margin-left: 3.6666%;">
										<div class="m-i-h-i-l-name" style="font-size:14px;color:#7e7e7e">{$feed['sourceInfo']['uname']}<span style="font-size:12px;color:#9a9a9a">{:FriendlyDate($feed['sourceInfo']['publish_time'])}</span></div>
										<p style="margin:0;font-size:1em;color:#9a9a9a;padding-right:5px;overflow:hidden; height:66px;line-height:22px;">{:getShort($feed['sourceInfo']['feed_content'],40)}</p>
									</div>
								</div>
							<php>} else if($feed['sourceInfo']['type']=='post'){</php>
								<div id="repost-{$feed['sourceInfo'][feed_id]}" class="m-i-b-p m-i-b-p-repost ts-listen" style="display:block" data-listen="weibo-detail-{$feed['sourceInfo']['feed_id']}"><span>@<a class="c_a" href="{:U('w3g/Index/weibo',array('uid'=>$feed['sourceInfo']['source_user_info']['uid']))}">{$feed.sourceInfo.source_user_info.uname}</a></span>:{:wapFormatContent($feed['sourceInfo'][feed_content]);}</div>
							<php>}else if($feed['sourceInfo']['type']=='repost'){</php>
								<div id="repost-{$feed['sourceInfo'][feed_id]}" class="m-i-b-p m-i-b-p-repost ts-listen" style="display:block" data-listen="weibo-detail-{$feed['sourceInfo']['feed_id']}"><span>@<a class="c_a" href="{:U('w3g/Index/weibo',array('uid'=>$feed['sourceInfo']['source_user_info']['uid']))}">{$feed.sourceInfo.source_user_info.uname}</a></span>:{:wapFormatContent($feed['sourceInfo'][feed_content]);}</div>
							<php>} else if($feed['sourceInfo']['type']=='postfile'){</php>
								<div id="repost-{$feed['sourceInfo'][feed_id]}" class="m-i-b-p m-i-b-p-repost ts-listen" style="display:block" data-listen="weibo-detail-{$feed['sourceInfo']['feed_id']}"><span>@<a class="c_a" href="{:U('w3g/Index/weibo',array('uid'=>$feed['sourceInfo']['source_user_info']['uid']))}">{$feed.sourceInfo.source_user_info.uname}</a></span>:{:wapFormatContent($feed['sourceInfo'][feed_content]);}</div>
								<div>
									<div class="attach_box">
										<php>foreach($feed['sourceInfo']['transpond_data']['attach'] as $value){
											switch($value['extension']){
												case 'png':$type='pic';break;
												case 'jpg':$type='pic';break;
												case 'jpeg':$type='pic';break;
												case 'bmp':$type='pic';break;
												case 'gif':$type='pic';break;
												case 'zip':$type='zip';break;
												case 'rar':$type='zip';break;
												case 'doc':$type='word';break;
												case 'docx':$type='word';break;
												case 'xls':$type='xls';break;
												case 'ppt':$type='ppt';break;
												case 'pdf':$type='pdf';break;
												default:$type='unknow';break;
											}
											$size=$value['size'];
											if($size > 1024 && $size< 1024*1024){
												$size=$size/1024;
												$size=round($size,2);
												$size.='K';
											}else if($size < 1024){
												$size.='B';
											}else{
												$size=$size/1024/1024;
												$size=round($size,2);
												$size.='M';
											}
										</php>
										<a class="downloadbox" target="_blank" href="{:U('widget/Upload/down',array('attach_id'=>$value['attach_id']))}" type="<php>echo $value['extension'];</php>">
											<div class="pure-g">
												<div class="d-name pure-u-3-4">
													<php>echo $value['attach_name'];</php>
													 <span><php>echo $size;</php></span>
												</div>
												<div class="pure-u-1-4">
													<span class="fa fa-download"></span>
												</div>
											</div>
										</a>
									<php>}</php>
								</div>
							</div>
						<php>}</php>
					<else/>
						<div id="repost-{$feed['sourceInfo'][feed_id]}" class="m-i-b-p m-i-b-p-repost ts-listen" style="display:block" data-listen="weibo-detail-{$feed['sourceInfo']['feed_id']}">
							<span>@<a class="c_a" href="{:U('w3g/Index/weibo',array('uid'=>$feed['sourceInfo']['api_source']['source_user_info']['uid']))}">{$feed.sourceInfo.api_source.source_user_info.uname}</a></span>:发表了一个帖子
							<a class="c_a" href="">{$feed['sourceInfo']['api_source']['title']}</a>在
							<a class="c_a" href="">{$feed['sourceInfo']['api_source']['weiba_name']}</a>
						</div>
					</neq>
					<php>}else{</php>
						<!-- 已被删除 -->
						<div class="c_zf_content">原文已被删除</div>
					<php>}</php>
	            </p>
	        </div>
		</div>

		<!-- 转发的原文 -->
		<php>if($feed['sourceInfo']['transpond_data']['type'] == 'postimage' || $feed['sourceInfo']['transpond_data']['type'] == 'postfile'){</php>
			<div class="m-i-b-p  m-i-b-p-repost" style="margin-top:-1em;background:rgba(3,3,3,0.1);">
				<php>if (($feed['sourceInfo']['type'] == 'repost' && $feed['sourceInfo']['api_source']['is_del'] == '0') || ($feed['sourceInfo']['type'] == 'repost' && $feed['transpond_data']['api_source']['is_del'] == '0') || ($feed['sourceInfo']['type'] == 'repost' && $feed['sourceInfo']['is_del'] == '0')) {</php>

					<!-- 转发的图 -->
					<div id="repost-{$feed['sourceInfo'][feed_id]}" class="repost-source ts-listen" style="padding:0;display:block；" data-listen="weibo-detail-{$feed['sourceInfo']['feed_id']}">
						<php>if($feed['sourceInfo']['api_source']['type'] == 'postimage'){</php>
							<img class="m-i-b-r-p" style="height:100%;float:left;width:33.3333%;max-width:33.3333%;" src="{$feed['sourceInfo']['transpond_data']['attach'][0]['attach_small']}" />
							<div style="float:right;width: 63%;margin-left: 3.6666%;">
								<div class="m-i-h-i-l-name" style="font-size:14px;color:#7e7e7e">{$feed['sourceInfo']['uname']}<span style="font-size:12px;color:#9a9a9a">{:FriendlyDate($feed['sourceInfo']['api_source']['publish_time'])}</span></div>
								<p style="margin:0;font-size:1em;color:#9a9a9a;padding-right:5px;overflow:hidden; height:66px;line-height:22px;">{:getShort($feed['sourceInfo']['api_source']['feed_content'],40)}</p>
							</div>
						<php>}</php>
					</div>

					<!-- 附件 -->
					<php>if(isset($feed['sourceInfo']['transpond_data']['attach']) && $feed['sourceInfo']['transpond_data']['type'] == 'postfile'){</php>
						<div>
							<div class="attach_box">
								<php>foreach($feed['sourceInfo']['attach'] as $value){
									switch($value['extension']){
										case 'png':$type='pic';break;
										case 'jpg':$type='pic';break;
										case 'jpeg':$type='pic';break;
										case 'bmp':$type='pic';break;
										case 'gif':$type='pic';break;
										case 'zip':$type='zip';break;
										case 'rar':$type='zip';break;
										case 'doc':$type='word';break;
										case 'docx':$type='word';break;
										case 'xls':$type='xls';break;
										case 'ppt':$type='ppt';break;
										case 'pdf':$type='pdf';break;
										default:$type='unknow';break;
									}
									$size=$value['size'];
									if($size > 1024 && $size< 1024*1024){
										$size=$size/1024;
										$size=round($size,2);
										$size.='K';
									}else if($size < 1024){
										$size.='B';
									}else{
										$size=$size/1024/1024;
										$size=round($size,2);
										$size.='M';
									}
								</php>
									<a class="downloadbox" target="_blank" href="{:U('widget/Upload/down',array('attach_id'=>$value['attach_id']))}" type="<php>echo $value['extension'];</php>">
										<div class="pure-g">
											<div class="d-name pure-u-3-4">
												<php>echo $value['attach_name'];</php>
												 <span><php>echo $size;</php></span>
											</div>
											<div class="pure-u-1-4">
												<span class="fa fa-download"></span>
											</div>
										</div>
									</a>
								<php>}</php>
							</div>
						</div>
			  		<php>}</php>
		  		<php>}elseif (($feed['sourceInfo']['type'] == 'repost' && $feed['sourceInfo']['api_source']['is_del'] == '1') || ($feed['type']['sourceInfo'] == 'repost' && $feed['transpond_data']['api_source']['is_del'] == '1') || ($feed['sourceInfo']['type'] == 'repost' && $feed['sourceInfo']['is_del'] == '1')) {</php>
				<!-- 原分享已被删除 -->
					<div class="c_zf_box">
						<dt class="bgcolor_arrow"><em class="arrline">◆</em><span class="downline">◆</span></dt>
						<div class="c_zf_content">原文已被删除</div>
					</div>
				<php>}</php>
			<!-- 原文的附件 -->
				<php>if(isset($feed['sourceInfo']['attach']) && $feed['sourceInfo']['type'] == 'postfile'){</php>
					<div>
						<div class="attach_box">
							<php>foreach($feed['sourceInfo']['attach'] as $value){
								switch($value['extension']){
									case 'png':$type='pic';break;
									case 'jpg':$type='pic';break;
									case 'jpeg':$type='pic';break;
									case 'bmp':$type='pic';break;
									case 'gif':$type='pic';break;
									case 'zip':$type='zip';break;
									case 'rar':$type='zip';break;
									case 'doc':$type='word';break;
									case 'docx':$type='word';break;
									case 'xls':$type='xls';break;
									case 'ppt':$type='ppt';break;
									case 'pdf':$type='pdf';break;
									default:$type='unknow';break;
								}
								$size=$value['size'];
								if($size > 1024 && $size< 1024*1024){
									$size=$size/1024;
									$size=round($size,2);
									$size.='K';
								}else if($size < 1024){
									$size.='B';
								}else{
									$size=$size/1024/1024;
									$size=round($size,2);
									$size.='M';
								}
							</php>
							<a class="downloadbox" target="_blank" href="{:U('widget/Upload/down',array('attach_id'=>$value['attach_id']))}" type="<php>echo $value['extension'];</php>">
								<div class="pure-g">
									<div class="d-name pure-u-3-4">
										<php>echo $value['attach_name'];</php>
										 <span><php>echo $size;</php></span>
									</div>
									<div class="pure-u-1-4">
										<span class="fa fa-download"></span>
									</div>
								</div>
							</a>
						<php>}</php>
					</div></div>
			  	<php>}</php>
				<!--转发原文结束-->

				<!--微吧 转发的原文 -->
				<php>if ($feed['sourceInfo']['type'] == 'weiba_repost' && $feed['sourceInfo']['api_source']['is_del'] == '0' || ($feed['sourceInfo']['source_table'] == 'weiba_repost' && $feed['sourceInfo']['api_source']['is_del'] == '0')){</php>
					<div id="c_zf_box_{$feed.sourceInfo.feed_id}" class="c_zf_box">
						<div class="c_zf_content">
	                        <span class="c_zf_content_name">@<a class="c_a" href="{:U('w3g/Index/weibo',array('uid'=>$feed['sourceInfo']['api_source']['source_user_info']['uid']))}">{$feed.sourceInfo.api_source.source_user_info.uname}</a></span>:
							发表了一个帖子<a class="c_a" href="">{$feed['sourceInfo']['api_source']['title']}</a>在<a class="c_a" href="">{$feed['sourceInfo']['api_source']['weiba_name']}</a>
							<div class="loadweiba" weibaid="{$feed.sourceInfo.api_source.post_id}">
								查看全文
							</div>
						</div>
					</div>
				<php>} elseif($feed['sourceInfo']['type'] == 'weiba_repost' && $feed['sourceInfo']['api_source']['is_del'] == '1' || ($feed['sourceInfo']['source_table'] == 'weiba_repost' && $feed['api_source']['is_del'] == '1')){</php>
					<!-- 原分享已被删除 -->
					<div class="c_zf_box">
						<div class="c_zf_content">原文已被删除</div>
					</div>
				<php>}</php>
			</div>
		<php>} else if($feed['sourceInfo']['transpond_data']['type'] == 'post'){</php>
			<div id="repost-{$feed['sourceInfo']['transpond_data'][feed_id]}" class="m-i-b-p m-i-b-p-repost ts-listen" style="display:block;background:rgba(3,3,3,0.1);margin-top:-1em" data-listen="weibo-detail-{$feed['sourceInfo']['transpond_data']['feed_id']}"><span>@<a class="c_a" href="{:U('w3g/Index/weibo',array('uid'=>$feed['sourceInfo']['transpond_data']['uid']))}">{$feed.sourceInfo.transpond_data.uname}</a></span>:{:wapFormatContent($feed['sourceInfo']['transpond_data'][feed_content]);}</div>
		<php>}</php>
		<div id="m-i-footer-{$feed.sourceInfo.feed_id}" class="m-i-footer">
            <div class="pure-g" data-uname="{$feed.user_info.uname}" data-uid="{$feed.user_info.uid}" data-cid="{$feed.comment_id}">
            	<div class="pure-u-1-2 ts-textcenter ts-listen" data-listen="weibo-list2reply-{$feed.sourceInfo.feed_id}" data-query="&to_uid={$feed['user_info']['uid']}&to_uname={$feed['user_info']['uname']}&to_comment_id={$feed.comment_id}" data-share="1" data-origin="{$feed.cancomment}" data-curorigin="{$feed.cancomment_current}" data-repost="{$feed['repost']}" data-ccid="{$feed.comment_id}">
	            	<div class="weibo-item-btn weibo-item-btn-reply"></div>
	            	<span class="ts-number">{$feed['comment_count']}</span>
	            </div>
                <div class="pure-u-1-2 ts-textcenter"  style="padding:0;">
                	<div class="weibo-item-btn weibo-item-btn-delete ts-listen" data-listen="weibo-list2delete-{$feed.comment_id}"></div>
                </div>
            </div>
        </div>
		<div id="c_{$feed.sourceInfo.feed_id}" class="c_replyme" cid="{$feed.sourceInfo.feed_id}" commentid="{$feed.comment_id}" rowid="{$feed.sourceInfo.feed_id}" appid="{$feed.uid}" touid="{$feed.uid}" page="" feedtype="{$feed.sourceInfo.type}" isdel="{$feed.sourceInfo.api_source.is_del}">
		<div class="c_zf_box"></div>
		<!-- 原文结束 -->
	</div>
	</div>
	</volist>
        <php>if($count>20){</php>
	<!-- 分页 -->
	<div id="pager_box">
		<php>if(empty($_GET['page']) || $_GET['page']==1){</php>
			<a href="javascript:;" link="" id="prev" class="pager_child pager_p_n_none pure-button pure-button-disabled">上一页</a>
		<php>}else{</php>
			<a href="javascript:;" data-link="{:U('w3g/Index/replyMe',array('page'=>$page-1))}" id="prev" class="pager_child pager_p_n pure-button  pure-button-primary ts-listen" data-listen="weibo-pagerReplace-click" data-for="replybox">上一页</a>
		<php>}</php>
		<php>
			$_GET['page']!=0?$get=$_GET['page']:$get=1;
			$_count = ceil($count/20);
		</php>
		<php>if($get == ($_count)) {</php>
			<a href="javascript:;" link="" id="next" class="pager_child pager_p_n_none pure-button pure-button-disabled">下一页</a>
		<php>}else{</php>
			<a href="javascript:;" data-link="{:U('w3g/Index/replyMe',array('page'=>$page+1))}" id="next" class="ts-listen pager_child pager_p_n pure-button pure-button-primary" data-listen="weibo-pagerReplace-click" data-for="replybox">下一页</a>
		<php>}</php>
	</div>
        <php>}</php>